<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.hs.pre.page.PageUtil"%>
<%@ page import="com.hs.pre.model.UserBean"%>
<%@ page import="com.hs.pre.page.PageUtil" %>
<%@ page import="com.hs.utils.*"%>
<%@ page import="com.hs.pre.sys.user.ParameterFinal" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	List list = new ArrayList();
	PageUtil pageUtil = (PageUtil) request.getAttribute("pageUtil");
	list = pageUtil.getResultList();
%>
<html>
	<head>
		<base href="<%=basePath%>">

		<title>用户列表</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<LINK href="<%=basePath%>/app/css/default.css" type=text/css
			rel=stylesheet>
			     <SCRIPT src="<%=path %>/app/js/common.js" type=text/javascript></SCRIPT>
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

	</head>

	<body>
	
		<table cellSpacing=0 align=right cellPadding=0 border=0>
			<tr>
				<td><form id="form2" name="form2" method="post" action="/pre/user.do?userDis=listUser">
					<table cellSpacing=0 align=right cellPadding=0 border=0 valign=top>
						<tr>
							<td>姓名:<input name="userName" type="text" class="buttom" value="<%=Utilities.null3Blank(request.getParameter("userName")) %>" >
								<input name="button" type="button" class="buttom"
									onclick="form2.submit();" value="查询">
							</td>
							<td>
								<input name="button" type="button" class="buttom"
									onclick="window.location='app/sys/user/adduser.jsp'" value="添加">
							</td>
							<td>
								<input name="button" type="button" class="buttom"
									onclick="form1.submit();" value="删除">
							</td>
							<td></td>
						</tr>
					</table>
				</form>
				</td>
			</tr>
			<tr>
				<td>
					<DIV class=tab>  
					<form id="form1" name="form1" method="post" action="/pre/user.do?userDis=delUser" >
						<TABLE
							style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all; TEXT-ALIGN: justify"
							width=100% cellSpacing=0 cellPadding=0 border=0>
							<TBODY>
								<TR class=top>
									<TD width=5%>
										<input type="checkbox" value="" id="sel_id" onclick="fullsel(form1,'sel_id','userId')" name="">
									</TD>
									<TD width=5%>
										序号
									</TD>
									<TD width=10%>
										帐号
									</TD>
									<TD width=20%>
										姓名
									</TD>
									<TD width=10%>
										是否管理员
									</TD>
									<TD width=10%>
										创建时间
									</TD>
									<TD width=10%>
										是否有效
									</TD>
									<TD width=10%>
										电子邮件
									</TD>
									<TD width=10%>
										创建ip
									</TD>
									<TD width=5%>
										修改
									</TD>
								</TR>
								<%
									int size = list.size();
									for (int i = 0; i < size; i++) {
										UserBean userBean = (UserBean) list.get(i);
								%>
								<TR align=center
									bgColor=<%if(i%2 == 0){out.println("#fffbff");}else{out.println("#eef1f9");} %>>
									<TD><input type="checkbox" name="userId" value="<%=userBean.getUserId() %>"  > </TD>
									<TD>
										<FONT color=#ff3300><%=pageUtil.getIPage().getThisNum() + i%></FONT>
									</TD>
									
									<TD><%=userBean.getLoginId()%></TD>
									<TD><%=userBean.getUserName()%></TD>
									<TD><%if(userBean.getIsAdmin() == ParameterFinal.ISADMIN_TRUE )out.print("是");else out.print("否"); %></TD>
									<TD><%=userBean.getCreateDate() %></TD>
									<TD><%if(userBean.getIsDelete() == ParameterFinal.ISADMIN_FALSE )out.print("有效");else out.print("无效");%></TD>
									<TD><%=userBean.getEmail()%></TD>
									<TD><%=userBean.getCreateIp() %></TD>
									<TD><a href="/pre/user.do?userDis=userView&userId=<%=userBean.getUserId() %>"><img border="0" width="25" heigth="25" src="app/images/user_edit.png" /></a></TD>
								</TR>
								<%
									}
								%>
							</TBODY>
						</TABLE>
						</form>
					</DIV>
				</td>
			</tr>
			<tr>
				<td><%=pageUtil.viewHTML()%></td>
			</tr>
		</table>
	</body>
</html>
